function updateClock() {
    const now = new Date();
    const hours = now.getHours();
    // console.log(hours);
    const minutes = now.getMinutes();
    // console.log(minutes);
    const seconds = now.getSeconds();
    // console.log(seconds);
    // console.log(hours, minutes, seconds);

    //更新DOM 显示时间
    document.querySelector('.timeBox p').innerHTML = `${hours}:${minutes}:${seconds}`;

    const hourHand = document.getElementById('hour');
    const minuteHand = document.getElementById('minute');
    const secondHand = document.getElementById('second');

    const hourDegrees = (hours % 12) * 30 + (minutes / 60) * 30;
    const minuteDegrees = (minutes / 60) * 360;
    const secondDegrees = (seconds / 60) * 360;
    // console.log(hourDegrees, minuteDegrees, secondDegrees);

    hourHand.style.transform = `rotate(${hourDegrees}deg)`;
    minuteHand.style.transform = `rotate(${minuteDegrees}deg)`;
    secondHand.style.transform = `rotate(${secondDegrees}deg)`;
}
updateClock()
setInterval(updateClock, 1000); // Update every second